home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
misc
/
emu
/
Apex-src.lha
/
XGET.XPL
< prev
next >
Wrap
Text File
|
2001-09-30
|
1KB
|
71 lines
\XGET.XPL DEC-05-89
\Program to get either a text or binary file using the XMODEM device.
\REVISION HISTORY:
\FEB-24-86, V1.0, Original.
\MAR-14-86, Modified to strip out (damn) linefeeds (nip 'em in the bud).
\APR-10-87, Changed string termination.
\APR-24-89, Minor mods.
\DEC-05-89, V2.0, Add option to get binary files.
code CHIN=7, CHOUT=8, CRLF=9, TEXT=12,
OPENI=13, OPENO=14, CLOSE=15;
def LF=$0A, EOF=$1A;
proc GETBIN; \Get binary file
int CH, I;
addr EOTFLG;
begin
EOTFLG:= $06A0; \Location in SYSPAG
TEXT(0, "GETTING...");
OPENI(5);
OPENO(3);
I:= 0;
loop begin
CH:= CHIN(5);
if EOTFLG(0) then quit;
CHOUT(3, CH);
I:= I +1; \Display a dot for each block received
if I & $00FF then else CHOUT(0, ^.);
end;
OPENI(5); \Send ACK to tell sender we're all done
CLOSE(3);
end; \GETBIN
proc GETTEXT; \Get text file
int CH;
begin
OPENI(5);
OPENO(3);
loop begin
repeat CH:= CHIN(5) until CH #LF; \Remove line feeds
if CH =EOF then quit;
CHOUT(3, CH);
CHOUT(0, CH);
end;
OPENI(5); \Send ACK to tell sender we're all done
CLOSE(3);
end; \GETTEXT
begin \MAIN
TEXT(0, "-- XMODEM FILE GETTER, V2.0 --
GET TEXT OR BINARY FILE (T/B)? ");
if (CHIN(0)!$20) =^b then GETBIN else GETTEXT;
end; \MAIN
ODEM FILE GETTER, V2.0 --
GET TEXT OR BINARY FILE (T/B)? ");
if (CHIN(0)!$20) =^b then GETBIN else GETTEXT;
end;